package com.jabex.persistence.util;

import org.hibernate.SessionFactory;
import org.hibernate.classic.Session;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import static junit.framework.Assert.assertNotNull;

/**
 * Created with IntelliJ IDEA.
 * User: Jerges Bello
 * Date: 10/11/13
 * Time: 21:44
 * To change this template use File | Settings | File Templates.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/spring/applicationContextDesarrollo.xml")
@Transactional
public class generateTables {
	@Autowired
	private SessionFactory sessionFactory;
	private Session currentSession;

	@Before
	public void openSession() {
		currentSession = sessionFactory.getCurrentSession();
	}

	@Test
	public void shouldHaveASessionFactory() {
		assertNotNull(sessionFactory);
	}


}
